package com.hefu.virtuallife.ui.map;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;

import com.fei.root.recater.adapter.CommonAdapter;
import com.fei.root.recater.viewholder.CommonHolder;
import com.hefu.virtuallife.R;
import com.hefu.virtuallife.base.BaseActivity;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;

public class TaxiMsgsActivity extends BaseActivity {


    @BindView(R.id.list)
    RecyclerView recyclerView;


    @Override
    protected int setLayoutId() {
        return R.layout.activity_taxi_msgs;
    }

    @Override
    protected void initVariables(@Nullable Bundle savedInstanceState) {
        ArrayList<String> arrayList=new ArrayList<>();
        arrayList.add("1");
        arrayList.add("1");
        arrayList.add("1");
        arrayList.add("1");
        arrayList.add("1");
        arrayList.add("1");
        CommonAdapter<String> adapter=new CommonAdapter<String>(arrayList,R.layout.layout_item_msg) {
            @Override
            protected void convert(CommonHolder holder, String s, int position) {
                int[] colors = getResources().getIntArray(R.array.gplus_colors);
                View view=holder.getView(R.id.idColor);
                view.setBackgroundColor(colors[position%colors.length]);
            }
        };
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);
    }

    @OnClick(R.id.img_return)
    protected void onFinishClick() {
        finish();
    }
}
